#include <stdio.h>

int CountDigit( int number, int digit );

int main()
{
    int number, digit;

    scanf("%d %d", &number, &digit);
    printf("Number of digit %d in %d: %d\n", digit, number, CountDigit(number, digit));

    return 0;
}

/* 你的代码将被嵌在这里 */
/*其中number是不超过长整型的整数，digit为[0, 9]区间内的整数。函数CountDigit应返回number中digit出现的次数。*/
int CountDigit( int number, int digit )
{
	 int count=0;
	 while(number>0)
	 {
		 if((number-number/10*10)==digit)
		 {
			 count++;
		 }
		 number=number/10;
	 }
	 return count;
}